/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.yogi.webframework.model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Yogi
 */
@Entity
@Table(name = "t_order_status")
@NamedQueries({
    @NamedQuery(name = "OrdoStatus.findAll", query = "SELECT o FROM OrdoStatus o"),
    @NamedQuery(name = "OrdoStatus.findById", query = "SELECT o FROM OrdoStatus o WHERE o.id = :id"),
    @NamedQuery(name = "OrdoStatus.findByOrderStatus", query = "SELECT o FROM OrdoStatus o WHERE o.orderStatus = :orderStatus")})
public class OrdoStatus implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Column(name = "ORDER_STATUS")
    private String orderStatus;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "ordoStatus")
    private List<Ordo> ordoList;

    public OrdoStatus() {
    }

    public OrdoStatus(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
    }

    public List<Ordo> getOrdoList() {
        return ordoList;
    }

    public void setOrdoList(List<Ordo> ordoList) {
        this.ordoList = ordoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OrdoStatus)) {
            return false;
        }
        OrdoStatus other = (OrdoStatus) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.yogi.webframework.model.OrdoStatus[id=" + id + "]";
    }

}
